<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
<script src="https://google.github.io/traceur-compiler/bin/traceur.js"></script>
<script src="https://google.github.io/traceur-compiler/bin/BrowserSystem.js"></script>
<script src="https://google.github.io/traceur-compiler/src/bootstrap.js"></script>
</head>
<body>
    <script>
        console.log("<!-----连接字符串---->")
        let a = 10;
        var c = '今天周一了';
        var d = `${c},妹妹在午睡`;
        console.log(d)

        console.log("<!-----块级作用域---->")
        {
            let b=20;
            console.log(b); 
        }  

        console.log("<!-----复制数组1---->")
        var arr1 = [1,2,3];
        var arr2 = arr1;
        arr2.pop();
        console.log(arr2,arr1)

        console.log("<!-----复制数组2---->")
        var arr1 = [1,2,3];
        var arr2 = [];
        
        for(var i=0;i<arr1.length;i++){
            arr2[i] = arr1[i];
        }
        arr2.pop();
        console.log(arr2,arr1)

        console.log("<!-----复制数组3---->")
        var arr3 = [1,2,3,4,5,6,7];
        var arr4 = Array.from(arr3);
        
        arr4.pop();
        console.log(arr3,arr4)

        console.log("<!-----复制数组4---->")
        var arr5 = [1,2,3,4];
        var arr6 = [...arr5];
        
        arr6.pop();
        console.log(arr5,arr6)

        // console.log("<!-----三个点的用法---->")
        // function add(){
        //     console.log(argument)//会提示argument is not defined
        // }
        // add(1,2,3)

        console.log("<!-----三个点的用法---->")
        function add2(...args){
            args.push(5)
            console.log(args)
        }
        add2(1,2,3)
    </script>
    
</body>
</html>